package test;

import lime2.Location;
import sagroup.dracots.DracoTS;
import sagroup.dracots.DracoTuple;
import sagroup.dracots.FlatShareTuple;

public class IngAgent implements Runnable {
	public void run() {
		DracoTS dts = DracoTS.get("testing");
		DracoTuple template = FlatShareTuple.createMatchAllRemoteTemplate(Location.build("localhost", 30000));

		DracoTuple[] ret = dts.ing(template);
		if (ret != null) {
			for (DracoTuple ts : ret)
				System.out.println("InpAgent has read and delete tuple with vid: " + ts.getVID());
			DracoTuple[] tempDt = dts.rdg(template);
			if ( tempDt== null || tempDt.length == 0) {
				System.out.println("Tuple is deleted!");
			}
		}
		System.out.println("IngAgent finished!");
	}
}
